<!DOCTYPE html>
<html >
<head>
    <!--删除表格的数据-->

    <title>DomeTest</title>
    <script>
        function dele(link){
            var table = document.getElementById("table");
            var td = link.parentNode;
            var tr = td.parentNode;
            var index = tr.rowIndex;
            table.dele(index);
        }
    </script>
</head>
<body>
<table id="table">
    <tr>
        <td>user</td>
        <td>操作</td>
    </tr>
    <tr>
        <td>user1</td>
        <td><a href="#" onclick="dele(this)">删除</a></td>
    </tr>
    <tr>
        <td>user2</td>
        <td><a href="#" onclick="dele(this)">删除</a></td>
    </tr>
    <tr>
        <td>user3</td>
        <td><a href="#" onclick="dele(this)">删除</a></td>
    </tr>
    <tr>
        <td>user4</td>
        <td><a href="#" onclick="dele(this)">删除</a></td>
    </tr>
    <tr>
        <td>user5</td>
        <td><a href="#" onclick="dele(this)">删除</a></td>
    </tr>
</table>

</body>
</html>